<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				list-style: none;
				float: left;
			}
			h2{
				margin-left: 10px;
				width: 150px;
				height: 30px;
				text-align: center;
			}
			.active{
				width: 150px;
				height: 30px;
				background-color: red;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<h2 :class="{active: a1}" @mousedown="b1">教父</h2>
			<h2 :class="{active: a2}" @mousedown="b2">阿甘正传</h2>
			<h2 :class="{active: a3}" @mousedown="b3">楚门的世界</h2>
			<h2 :class="{active: a4}" @mousedown="b4">盗梦空间</h2>
		</div>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var app = new Vue({
				el:"#app",
				data:{
					a1:true,
					a2:false,
					a3:false,
					a4:false
				},
				methods:{
					b1(){
						if(this.a1==true){
							this.a1=false
						}else{
							this.a1=true,
							this.a2=false,
							this.a3=false,
							this.a4=false
						}
					},
					b2(){
						if(this.a2==true){
							this.a2=false
						}else{
							this.a2=true,
							this.a1=false,
							this.a3=false,
							this.a4=false
						}
					},
					b3(){
						if(this.a3==true){
							this.a3=false
						}else{
							this.a3=true,
							this.a1=false,
							this.a2=false,
							this.a4=false
						}
					},
					b4(){
						if(this.a4==true){
							this.a4=false
						}else{
							this.a4=true,
							this.a1=false,
							this.a3=false,
							this.a2=false
						}
					}
				}
			})
		</script>
	</body>
</html>
